<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>right通讯录</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
* {
	padding: 0;
	margin: 0;
}

body {
	background-color: #1ebbdc;
}

#right {
	width: 200px;
	height: 500px;
	background-image: url("/SBD_OASystem/images/AdminCC/left.gif");
	background-repeat: no-repeat;
	overflow: auto;
}

#menu {
	width: 175px;
	margin-top: 50px;
	margin-left: 15px;
}

.menuSpan {
	width: 150px;
	height: 20px;
	cursor: pointer;
	display: block;
	line-height: 20px;
	text-align: center;
	text-decoration: none;
	font-family: "Turmoil (BRK)";
	font-size: 20px;
	color: white;
	background-image: url("/SBD_OASystem/images/AdminCC/leftButton1.gif");
}

.group {
	display: none;
	margin-left: 30px;
}

label,a {
	cursor: pointer;
	font-size: 14px;
	color: white;
}

#add {
	float: right;
}

#addGroup,#addFrend {
	font-size: 11px;
}

#ul_later li {
	cursor: pointer;
	list-style: none;
	margin-left: 10px;
	color: white;
}

li div {
	margin-left: 20px;
	display: none;
}

#div_qiye ul li,#div_geren ul li {
	cursor: pointer;
	list-style: none;
	margin-left: 10px;
	display: none;
	color: white;
}
</style>
<script type="text/javascript" src="./jQuery/jquery-1.9.1.js"></script>
</head>
<script type="text/javascript">
	$(function() {

		//通信录点击事件
		$("#menu>span").click(function() {
			$("#div_" + this.id).toggle();
		});

		//分组点击事件
		$("div>label").click(function() {
			$(this).next("ul").children("li").toggle();
		});

		//联系人点击事件
		$("li>label").click(function() {
			$(this).parent("li").children("div").toggle();
			$(this).parent("li").siblings().children("div").hide();
		});
		

		//鼠标移入移出事件
		$("#menu>span,a,label").mouseover(function() {
			$(this).css({
				"background-color" : "#46A3FF"
			});
		}).mouseout(function() {
			$(this).css({
				"background-color" : ""
			});
		});

	});
</script>
<body>
	<div id="right">
		<div id="menu">
			<span id="qiye" class="menuSpan">企业通讯录</span>
			<div id="div_qiye" class="group">
				<s:iterator value="depts" var="dept">
					<label> <s:property value="#dept.dname" /> </label>
					<ul id="a1">
						<s:iterator value="#dept.emps" var="demp">
							<li>
							<label><s:property value="#demp.ename" /></label> <br>
								<div>
									<a target="yxg_center" href="/SBD_OASystem/pages/yxg/message/message.jsp?toempno=<s:property value="#demp.empno" />">发送消息</a><br> 
									<a target="yxg_center" href="/SBD_OASystem/pages/yxg/email/email.jsp?toempno=<s:property value="#demp.empno" />">发送邮件</a>
								</div>
							</li>
						</s:iterator>
					</ul>
				</s:iterator>
			</div>
			<span id="geren" class="menuSpan">个人通讯录</span>
			<div id="div_geren" class="group">
				<div id="add">
					<a id="addGroup" target="yxg_center"
						href="pages/yxg/Contacts/AddGroup.jsp">
						添加分组&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp; </a> <br> <a id="addFrend"
						target="yxg_center" href="pages/yxg/Contacts/AddGroupEmp.jsp">
						添加联系人&gt;&gt; </a>
				</div>
				<s:iterator value="tgroups" var="group">
					<label> <s:property value="#group.gname" /> </label>
					<ul id="a1">
						<s:iterator value="#group.groupEmps" var="gemp">
							<li>
							<label><s:property value="#gemp.ename" /></label> <br>
								<div>
									<a target="yxg_center" href="/SBD_OASystem/pages/yxg/message/message.jsp?toempno=<s:property value="#gemp.empno" />">发送消息</a><br> 
									<a target="yxg_center" href="/SBD_OASystem/pages/yxg/email/email.jsp?toempno=<s:property value="#demp.empno" />">发送邮件</a>
								</div>
							</li>
						</s:iterator>
					</ul>
				</s:iterator>
			</div>
			<span id="later" class="menuSpan">最近联系人</span>
			<div id="div_later" class="group">
				<ul id="ul_later">
					<li value="zhangsan"><label>张三</label> <br>
						<div>
							<a>发送消息</a><br> <a>发送邮件</a>
						</div></li>
					<li><label>李四</label> <br>
						<div>
							<a>发送消息</a><br> <a>发送邮件</a>
						</div></li>
					<li><label>王麻子</label> <br>
						<div>
							<a>发送消息</a><br> <a>发送邮件</a>
						</div></li>
				</ul>
			</div>
			<label>当前员工:</label>${emp.ename}
		</div>
	</div>
</body>
</html>
